//package cn.bonoon.controllers.shortcutMenu;
//
//import javax.servlet.http.HttpServletRequest;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import cn.bonoon.core.plugins.ShortcutMenuService;
//import cn.bonoon.entities.plugins.ShortcutMenuEntity;
//import cn.bonoon.kernel.util.StringHelper;
//import cn.bonoon.kernel.web.controllers.AbstractController;
//import cn.bonoon.kernel.web.models.JsonResult;
//
///**
// * 快捷菜单
// * 
// * @author ocean~
// */
//@Controller
//@RequestMapping("s/user/shortcutMenu")
//public class ShortcutMenuController extends AbstractController {
//	@Autowired
//	private ShortcutMenuService shortcutMenuService;
//
//	@ResponseBody
//	@RequestMapping(value = "save", method = { RequestMethod.GET, RequestMethod.POST })
//	public JsonResult save(HttpServletRequest request, 
//			@RequestParam("mid") String mid, 
//			@RequestParam("rename") String rename, 
//			@RequestParam("type") Integer type) {
//		try {
//			shortcutMenuService.save(getUser(), mid, rename, type);
//		} catch (Exception e) {
//			e.printStackTrace();
//			return JsonResult.error("数据异常，操作失败！");
//		}
//		return JsonResult.result();
//	}
//
//	@ResponseBody
//	@RequestMapping(value = "update/name", method = { RequestMethod.GET, RequestMethod.POST })
//	public JsonResult update_name(HttpServletRequest request, 
//			@RequestParam("id") Long id, 
//			@RequestParam("name") String name) {
//		try {
//			if (StringHelper.isNotEmpty(name)) {
//				ShortcutMenuEntity entity = shortcutMenuService.get(id);
//				entity.setName(name);
//				shortcutMenuService.update(getUser(), entity);
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//			return JsonResult.error("数据异常，操作失败！");
//		}
//		return JsonResult.result();
//	}
//
//	@ResponseBody
//	@RequestMapping(value = "update/ordinal", method = { RequestMethod.GET, RequestMethod.POST })
//	public JsonResult update_ordinal(HttpServletRequest request, 
//			@RequestParam("ids") String ids) {
//		try {
//			shortcutMenuService.sort(getUser(), StringHelper.toLongArray(ids));
//		} catch (Exception e) {
//			e.printStackTrace();
//			return JsonResult.error("数据异常，操作失败！");
//		}
//		return JsonResult.result();
//	}
//
//	@ResponseBody
//	@RequestMapping(value = "update/module", method = { RequestMethod.GET, RequestMethod.POST })
//	public JsonResult update_module(HttpServletRequest request, 
//			@RequestParam("id") Long id, 
//			@RequestParam("type") Integer type) {
//		try {
//			shortcutMenuService.update_module(getUser(), id, type);
//		} catch (Exception e) {
//			e.printStackTrace();
//			return JsonResult.error("数据异常，操作失败！");
//		}
//		return JsonResult.result();
//	}
//
//	@ResponseBody
//	@RequestMapping(value = "detele", method = { RequestMethod.GET, RequestMethod.POST })
//	public JsonResult detele(HttpServletRequest request, 
//			@RequestParam("id") Long id) {
//		try {
//			ShortcutMenuEntity entity = shortcutMenuService.get(id);
//			shortcutMenuService.delete(getUser(), entity);
//		} catch (Exception e) {
//			e.printStackTrace();
//			return JsonResult.error("数据异常，操作失败！");
//		}
//		return JsonResult.result();
//	}
//}
